<?php

require('lib/gymnasium.php');
$id = intval($_GET['id']);

$gym = gym_get_by_id($id);
?>
<div>
	<h2>Détails : <?php echo $gym['name']; ?></h2>
	<span class="back"><a href="gymnases.html">Revenir à la liste des gymnases</a></span>
	<?php
	if ($gym == NULL) {
		?>
		<p class="error">
			Le gymnase demandé n'existe pas
		</p>
		<?php
	}
	else {
		?>
		<table class="data-display">
			<tr>
				<td>Nom : </td>
				<td><?php echo $gym['name'] ?></td>
			</tr>
			<tr>
				<td>Adresse : </td>
				<td><?php echo $gym['address'].'<br />'.$gym['postal_code'].' '.$gym['city'] ?></td>
			</tr>
			<tr>
				<td>Description&nbsp;: </td>
				<td><?php echo nl2br($gym['description']) ?></td>
			</tr>
			<tr>
				<td>Plan d'accès :</td>
				<td><?php echo $gym['googlemap_url'] ?></td>
			</tr>
		</table>	
		<?php
	}
	?>
</div>

